package com.xrui.myexprparser;

import org.antlr.v4.runtime.CharStreams;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.tree.ParseTree;

public class ParserTest {
    public static void main(String args[]){
        String sql = " a.test LIKE 'Kash%'";

        ExprSyntaxLexer lexer = new ExprSyntaxLexer(CharStreams.fromString(sql));
        ExprSyntaxParser parser = new ExprSyntaxParser(new CommonTokenStream(lexer));
        ParseTree root = parser.queryexpression();

        ASTEvaluator visitor = new ASTEvaluator();
        Object result = visitor.visit(root);


        System.out.println(result);
        //System.out.println(root.toStringTree(parser));
    }
}
